<template>
  <div>

    <el-breadcrumb>
      <el-breadcrumb-item to="/" style="margin: 20px">首页</el-breadcrumb-item>
      <el-breadcrumb-item></el-breadcrumb-item>

      <el-dropdown style="width: 140px; cursor: pointer">
        <div style="display: inline-block">
      <img :src="student.photo" alt=""
               style="width: 30px; border-radius: 50%; position: relative; top: 10px; right: 5px">
          <span>{{ student.stuName }}</span><i class="el-icon-arrow-down" style="margin-left: 5px"></i>
        </div>
        <el-dropdown-menu slot="dropdown" style="width: 100px; text-align: center">
          <el-dropdown-item style="font-size: 14px; padding: 5px 0">
            <router-link to="/Person">个人信息</router-link>
          </el-dropdown-item>
          <el-dropdown-item style="font-size: 14px; padding: 5px 0">
            <span style="text-decoration: none" @click="getOuts">退出</span>
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </el-breadcrumb>
  </div>
</template>

<script>
export default {

  name: "Header",
  props:{
    student:Object
  },


  data() {
    return {
      /*  animal: localStorage.getItem("animal") ? JSON.parse(localStorage.getItem("animal")) : {}*/
    }
  },

  methods:{
    getOuts(){
      this.$router.push("/Login");
      localStorage.removeItem("student"); //用于删除登录号遗留的账号与密码 防止信息泄露
      this.$message.success("退出成功")
    }

  }

}
</script>

<style scoped>

</style>
